package interfaces;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.JFrame;


import windows.ObjectWindow;
import windows.Window;

public class LabelClick implements MouseListener{

	private Object object;
	private JFrame window;
	private Controller controller;
	
	public LabelClick(Object object, JFrame window, Controller controller){
		this.object = object;
		this.window = window;
		this.controller = controller;
	}
	
	@Override
	public void mouseClicked(MouseEvent arg0) {
		window.setVisible(false);
		if(controller.gotCollections(object)){
			new Window(object, window, controller);
		}else{
			new ObjectWindow(object, window, controller);
		}
	}


	@Override
	public void mouseEntered(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseExited(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mousePressed(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseReleased(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}

}
